package com.jh.paymentchannel.repository;

import com.jh.paymentchannel.pojo.PaymentOrderStatistic;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.time.LocalDate;


/**
 * {@link PaymentOrderStatistic} entity repository.
 *
 * @author Fuchun
 * @since 1.0
 */
@Repository
public interface PaymentOrderStatisticRepository extends
        JpaRepository<PaymentOrderStatistic, Long>, JpaSpecificationExecutor<PaymentOrderStatistic>,
        PaymentOrderStatisticRepositoryCustom {

    Page<PaymentOrderStatistic> findByUserId(Long userId, Pageable pageable);

    Page<PaymentOrderStatistic> findByTransferredFalse(Pageable pageable);

    long countByFromDateAndToDate(LocalDate fromDate, LocalDate toDate);
}
